** README

/*

The replication of the paper "The Torrents of Spring. The Role of Governance Capacity in the Developing World during the COVID-19 pandemics"
consists of 1 script and two databases in dta format. The first database has data on a monthly scale, and the second has data on a bi-weekly scale (DYNAMIC PANEL (biweekly data).

The first command opens the complete dataset and then selects the variables that are of interest in the manuscript.

We have indicated in asterisks commands that were used to produce some variables used in the manuscript,
but which are already open in the database (STRINGENCY DATA transformation).

We present the commands to obtain the results for each Table or Figure in the manuscript.
.

*/

************************************************************************************************
************************************************************************************************
* CROSS SECTIONAL AND PANEL DATA ANALYSIS (monthly data) ***************************************
************************************************************************************************
************************************************************************************************

* Openning the dataset
use "C:\Users\Samsung\Desktop\Arquivos papers em andamento\BPSR\Monthly Data BPSR.dta" , clear

******************************************
******* SOURCE OF DATA: ******************
******************************************


* Independent Measures - State Capacity
* BTI: The BTI Transformation Index is a project of Bertelsmann Stiftung
* https://bti-project.org/en/about


* Dependent Measures: COVID OUTPUT 
* COVID-19 Government Response Tracker
* https://www.bsg.ox.ac.uk/research/covid-19-government-response-tracker



* CONTROL VARIABLES
* Quality of Government Institute https://www.gu.se/en/quality-government/qog-data
* Inequality - Standardized World Income Inequality Database (https://fsolt.org/swiid/)



* STRINGENCY DATA transformation
*gen str_june = stringency if mes <5.1
*gen str_july = stringency if mes <6.1
*gen str_august = stringency if mes <7.1
*gen str_september = stringency if mes <8.1
*gen str_october = stringency if mes <9.1
*gen str_november = stringency if mes <10.1


*egen strmean_june = mean(str_june), by (ccode)
*egen strmean_july = mean(str_july), by (ccode)
*egen strmean_august = mean(str_august), by (ccode)
*egen strmean_september = mean(str_sep), by (ccode)
*egen strmean_october = mean(str_october), by (ccode)
*egen strmean_november = mean(str_november), by (ccode)

* Indicating the variables of interest that are going to be analyzed
keep strmean* confirmeddeaths ldeaths confirmedcases lconfirmed stringencyindex bti_gp bti_ssn gini_disp bmr_dem lpib  lpop diat_ti   wdi_pop65 wdi_popurb ///
wdi_pop wdi_gdpcappppcon2011 wdi_gdppppcon2011 mes countryname confirmeddeaths confirmedcases stringencyindex   ineq  ccode ///
bti_2020_steecap bti_2020_re bti_2020_consbuil bti_2020_ic

* TABLE 1
* Summary statistics for the mensal dataset.
sum     confirmeddeaths ldeaths confirmedcases lconfirmed stringencyindex if     bti_gp !=.
sum     bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65 wdi_popurb if     bti_gp !=.
sum 	wdi_pop wdi_gdpcappppcon2011 wdi_gdppppcon2011 if     bti_gp !=.



* TABLE 2
* Cross-section Regressions for each month. The command OUTREG needs to be installed.
* Each outreg command produces one column. The outreg produces the almost final table.

* installing the OUTREG command;
ssc install outreg
 
 
reg ldeaths   strmean_june           	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65 wdi_popurb  if mes==5
outreg, se starlevels(10 5 1 0.1) bdec(2) 
reg ldeaths   strmean_july          	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65 wdi_popurb  if mes==6
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg ldeaths   strmean_august          	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65 wdi_popurb  if mes==7
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg ldeaths   strmean_september        	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65 wdi_popurb  if mes==8
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg ldeaths   strmean_october         	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==9
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg ldeaths   strmean_november        	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge

reg lconfirmed   strmean_june           bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==5
outreg, se starlevels(10 5 1 0.1) bdec(2) 
reg lconfirmed   strmean_july          	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==6
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg lconfirmed   strmean_august       	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==7
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg lconfirmed   strmean_september     	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==8
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg lconfirmed   strmean_october        bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==9
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg lconfirmed   strmean_november       bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge



** FIGURE 2
* Cross section Regression for November and the added-variable graph plotted in the manuscript. We reproduce the November death regression.
reg ldeaths   strmean_november        	bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
avplot bti_gp , mlabel(countryname) mlabsize(tiny) mlabcolor(black) ytitle("Expected values of deaths (log)") xtitle ("BTI Governance Index (State Capacity)") ///
 plotregion(fcolor(white)) graphregion(fcolor(white))  ylabel(-6(2)4) xlabel(-2(1)2) 



*** PANEL (monthly data)
* Creation of the variables per month (not accumulated) for the pandemics output.
gen month_deaths = confirmeddeaths - l.confirmeddeaths
gen lmonth_deaths = log(month_deaths)
replace lmonth_deaths = 0 if month_deaths == 0

gen month_cases = confirmedcases - l.confirmedcases
gen lmonth_cases = log(month_cases)
replace lmonth_cases = 0 if month_cases == 0


** TABLE 3
* Panel Data Random Effects Regression for the accumulated number of cases/deaths.
* Each outreg command produces one column. The outreg produces the almost final table.
xtreg ldeaths   			l.stringencyindex           bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.mes  if mes<11	
outreg, se starlevels(10 5 1 0.1) bdec(2)
xtreg ldeaths l.lconfirmed  l.stringencyindex           bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.mes  if mes<11	
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lconfirmed  			l.stringencyindex      		bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.mes  if mes<11   
outreg, se starlevels(10 5 1 0.1) bdec(2) merge

* Panel Data Random Effects Regression for the monthly number of cases/deaths.
xtreg lmonth_deaths    				 l.stringencyindex  bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.mes  if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lmonth_deaths l.lmonth_cases   l.stringencyindex  bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.mes  if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lmonth_cases  				 l.stringencyindex 	bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.mes  if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge




* Table 5
/*
sum bti_ic // international cooperation
sum bti_lod // Level of Difficulty
sum bti_epg //Effective Power to Govern
sum bti_ba // Basic Administration
*/

* Table 5 Column 1
*** PAINEL SUPERIOR ***
* Cross section Regressions for the month of november of each kind of the Governance Index dimensions. We ignore the first regression, as it was
* already presented in Table 2 
* Each set produces one column. For the table, we just present the coeficient of interest.

* SET 1
reg ldeaths   strmean_november         	bti_gp 					 	bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) 
reg ldeaths   strmean_november         			bti_2020_steecap 	bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg ldeaths   strmean_november         			bti_2020_re 		bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg ldeaths   strmean_november         			bti_2020_consbuil 	bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg ldeaths   strmean_november         			bti_2020_ic 		bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
*** PAINEL INFERIOR ***
reg ldeaths   strmean_november         	bti_2020_steecap bti_2020_re bti_2020_consbuil bti_2020_ic bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge


** TABLE 5 (column 2)
* PAINEL SUPERIOR
* Panel Data Regressions for each kind of the Governance Index dimensions. We ignore the first regression, as it was
* already presented in Table 2

* SET 2
xtreg ldeaths l.lconfirmed  l.stringencyindex           bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) 
xtreg ldeaths l.lconfirmed  l.stringencyindex 	bti_2020_steecap bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg ldeaths l.lconfirmed  l.stringencyindex 	bti_2020_re bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg ldeaths l.lconfirmed  l.stringencyindex 	bti_2020_consbuil bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg ldeaths l.lconfirmed  l.stringencyindex  	bti_2020_ic bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
*PAINEL INFERIOR
xtreg ldeaths l.lconfirmed  l.stringencyindex  	bti_2020_steecap bti_2020_re bti_2020_consbuil bti_2020_ic bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge


* Table 5 Column 3
*** PAINEL SUPERIOR ***
* SET 3
reg lconfirmed   strmean_november         	bti_gp 					 	bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) 
reg lconfirmed   strmean_november         			bti_2020_steecap 	bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg lconfirmed   strmean_november         			bti_2020_re 		bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg lconfirmed   strmean_november         			bti_2020_consbuil 	bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
reg lconfirmed   strmean_november         			bti_2020_ic 		bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
*** PAINEL INFERIOR ***
reg lconfirmed   strmean_november         	bti_2020_steecap bti_2020_re bti_2020_consbuil bti_2020_ic					 	bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
outreg, se starlevels(10 5 1 0.1) bdec(2) merge




** TABLE 5 (column 4)
* PAINEL SUPERIOR
* SET 4
xtreg lconfirmed  l.stringencyindex       	bti_gp 		  bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) 
xtreg lconfirmed  l.stringencyindex      bti_2020_steecap bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lconfirmed  l.stringencyindex      bti_2020_re bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lconfirmed  l.stringencyindex      bti_2020_consbuil bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lconfirmed  l.stringencyindex      bti_2020_ic bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
* PAINEL INFERIOR
xtreg lconfirmed  l.stringencyindex  	bti_2020_steecap bti_2020_re bti_2020_consbuil bti_2020_ic bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge

** TABLE 5 (column 5)
* PAINEL SUPERIOR
* SET 5
xtreg lmonth_deaths l.lmonth_cases  l.stringencyindex           bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) 
xtreg lmonth_deaths l.lmonth_cases  l.stringencyindex 	bti_2020_steecap bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lmonth_deaths l.lmonth_cases  l.stringencyindex 	bti_2020_re bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lmonth_deaths l.lmonth_cases  l.stringencyindex 	bti_2020_consbuil bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lmonth_deaths l.lmonth_cases  l.stringencyindex  	bti_2020_ic bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
* PAINEL INFERIOR
xtreg lmonth_deaths l.lmonth_cases  l.stringencyindex  	bti_2020_steecap bti_2020_re bti_2020_consbuil bti_2020_ic bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge


** TABLE 5 (column 6)
* PAINEL SUPERIOR
* SET 6
xtreg lmonth_cases  l.stringencyindex      bti_gp bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) 
xtreg lmonth_cases  l.stringencyindex      bti_2020_steecap bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lmonth_cases  l.stringencyindex      bti_2020_re bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lmonth_cases  l.stringencyindex      bti_2020_consbuil bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
xtreg lmonth_cases  l.stringencyindex      bti_2020_ic bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge
* PAINEL INFERIOR
xtreg lmonth_cases  l.stringencyindex      bti_2020_steecap bti_2020_re bti_2020_consbuil bti_2020_ic bti_ssn gini_disp i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
outreg, se starlevels(10 5 1 0.1) bdec(2) merge


**************************************************************************************************
** INTERACTIONS **********************************************************************************
**************************************************************************************************

* Analysis of interactions that were not presented in tables or graphs, but whose results were reported in the text.

reg ldeaths   strmean_nov         	c.bti_gp##c.gini_disp 	bti_ssn  	i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
reg ldeaths   strmean_nov         	c.bti_gp##i.ineq 		bti_ssn  	i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
reg ldeaths   strmean_nov         	c.bti_gp##i.bmr_dem 	bti_ssn  	gini_disp lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10
reg ldeaths   strmean_nov         	c.bti_gp##c.bti_ssn 	gini_disp  	i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb if mes==10


xtreg ldeaths   l.stringencyindex l.lconfirmed        	c.bti_gp##c.gini_disp 	bti_ssn  i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
xtreg ldeaths   l.stringencyindex l.lconfirmed        	c.bti_gp##i.ineq 		bti_ssn  i.bmr_dem lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11
xtreg ldeaths   l.stringencyindex l.lconfirmed        	c.bti_gp##i.bmr_dem 	bti_ssn  gini_disp lpib  lpop diat_ti   wdi_pop65  wdi_popurb i.mes if mes<11


*** Interação Desigualdade
xtreg ldeaths   l.stringencyindex           c.bti_gp##i.ineq bti_ssn   i.bmr_dem diat_ti lpib   lpop   wdi_pop65 wdi_popurb  i.mes if mes<11
margins ineq,  at(bti_gp=(1(1)8))
marginsplot, xdimension(at(bti_gp)) recast(line) recastci(rarea) title("Log Deaths") ///
name (deaths1a, replace) graphregion(color(white))      xtitle("Governance Capacities")  ytitle("Predicted Values") legend(on)


*** Interação Democracia
xtreg ldeaths    l.stringencyindex           c.bti_gp##i.bmr_dem bti_ssn gini_disp  diat_ti lpib   lpop   wdi_pop65 wdi_popurb  i.mes if mes<11
margins bmr_dem,  at(bti_gp=(1(1)8))
marginsplot, xdimension(at(bti_gp)) recast(line) recastci(rarea) title("Log Deaths") ///
 name (deaths2a, replace) graphregion(color(white))       xtitle("") ytitle("Predicted Values") legend(on)



graph combine deaths1a deaths2a ,   altshrink graphregion(color(white)) col(1)


************************************************************************************************
************************************************************************************************
* DYNAMIC PANEL (byweekly data) ****************************************************************
************************************************************************************************
************************************************************************************************

* Openning the dataset
use "C:\Users\Samsung\Desktop\Arquivos papers em andamento\BPSR\Biweekly Data BPSR.dta", clear

/*gen month_deaths = confirmeddeaths - l.confirmeddeaths
gen lmonth_deaths = log(month_deaths)
replace lmonth_deaths = 0 if month_deaths == 0

gen month_cases = confirmedcases - l.confirmedcases
gen lmonth_cases = log(month_cases)
replace lmonth_cases = 0 if month_cases == 0
*/

keep  confirmeddeaths ldeaths confirmedcases lconfirmed stringencyindex bti_gp bti_ssn gini_disp bmr_dem lpib  lpop diat_ti   wdi_pop65 wdi_popurb ///
wdi_pop wdi_gdpcappppcon2011 wdi_gdppppcon2011  countryname confirmeddeaths confirmedcases stringencyindex   ineq  ccode ///
bti_2020_steecap bti_2020_re bti_2020_consbuil bti_2020_ic quinzena


* installing the XTABOND2 command;
ssc install xtabond2

* TABLE 4 - PD
* Dynamic Panel Data  Regression for the accumulated number of accumulated cases/deaths.
* Each outreg command produces one column. The outreg produces the almost final table.

xtabond2 ldeaths l.ldeaths     l2.stringencyindex 	bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.quinzena if quinzena <22, /// 
ivstyle (l.lconfirmed l.stringencyindex bti_gp bti_ssn  i.bmr_dem diat_ti lpib   lpop   wdi_pop65 wdi_popurb ) gmmstyle (l.ldeaths  ) 
outreg, se starlevels(10 5 1 0.1) bdec(2) 

xtabond2 ldeaths l.ldeaths   l.lconfirmed   l2.stringencyindex 	bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.quinzena if quinzena <22 , /// 
ivstyle (l.lconfirmed l.stringencyindex bti_gp bti_ssn  i.bmr_dem diat_ti lpib   lpop   wdi_pop65 wdi_popurb ) gmmstyle (l.ldeaths ) 
outreg, se starlevels(10 5 1 0.1) bdec(2) merge

xtabond2 ldeaths l.ldeaths l2.ldeaths   l2.stringencyindex 	bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.quinzena if quinzena <22, /// 
ivstyle (l.lconfirmed l.stringencyindex bti_gp bti_ssn  i.bmr_dem diat_ti lpib   lpop   wdi_pop65 wdi_popurb ) gmmstyle (l.ldeaths l2.ldeaths) 
outreg, se starlevels(10 5 1 0.1) bdec(2) merge

xtabond2 ldeaths l.ldeaths l2.ldeaths l.lconfirmed   l2.stringencyindex 	bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.quinzena if quinzena <22 , /// 
ivstyle (l.lconfirmed l.stringencyindex bti_gp bti_ssn  i.bmr_dem diat_ti lpib   lpop   wdi_pop65 wdi_popurb ) gmmstyle (l.ldeaths l2.ldeaths) 
outreg, se starlevels(10 5 1 0.1) bdec(2) merge

xtabond2 lconfirmed l.lconfirmed  l.stringencyindex  			bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.quinzena if quinzena <22 , /// 
ivstyle (l.stringencyindex bti_gp bti_ssn gini_disp i.bmr_dem diat_ti lpib   lpop   wdi_pop65 wdi_popurb  ) gmmstyle (l.lconfirmed ) 
outreg, se starlevels(10 5 1 0.1) bdec(2) merge

xtabond2 lconfirmed l.lconfirmed l2.lconfirmed l.stringencyindex  			bti_gp bti_ssn gini_disp i.bmr_dem  lpib   lpop  diat_ti  wdi_pop65 wdi_popurb  i.quinzena if quinzena <22 , /// 
ivstyle (l.stringencyindex bti_gp bti_ssn gini_disp i.bmr_dem diat_ti lpib   lpop   wdi_pop65 wdi_popurb  ) gmmstyle (l.lconfirmed l2.lconfirmed)  
outreg, se starlevels(10 5 1 0.1) bdec(2) merge


